package com.yang.o2o.util;

public class PathUtil {
    //获取系统文件的分隔符
    private static String separator = System.getProperty("file.separator");

    public static String getImgBasePath(){
        String os = System.getProperty("os.name");
        String basePath = "";
        if(os.toLowerCase().startsWith("win")){
            basePath = "C:/project/images/";
        }else{
            basePath = "/Users/yang/images/";
        }
//        替换成系统的分隔符
        basePath = basePath.replace("/",separator);

        return basePath;
    }

    public static String getShopImagePath(long shopId){
        String imagesPath = "upload/images/item/shop/" + shopId + "/";
        return imagesPath.replace("/",separator);
    }
}
